<template>
<!-- 产品预览页面 -->
  <div>
        <van-row>
          <van-col :span="12"  class="d1" v-for="(item) in product" :key="item" lazy-load >
            <!-- <div class="proditem" > -->
              <el-card >
                <div class="d2">
                  <van-image :src=item.imgurl class="image" @click="toView(item)"  />
                </div>
                <div class="prodname">
                  <p>{{item.name}} {{item.price}}</p>
                  <div class="bottom">
                    <p >{{item.shopname}}</p>
                    <!-- <van-action-bar-icon icon="star"  color="#ff5000" /> -->
                      <i class="el-icon-star-off" v-if="!item.isstar" @click="submitfavoritesoff(item)"></i>
                      <i class="el-icon-star-on" v-if="item.isstar" @click="submitfavoriteson(item)"></i>
                    <van-action-bar-button type="warning" text="加入购物车" @click='submitForm(item)'/>
                    <van-action-bar-button type="danger" text="立即购买" />                   
                  </div>
                </div>
              </el-card>
            <!-- </div> -->
          </van-col>

          <van-col :span="12">
            <div class="demo-rate-block">
              <span class="demonstration">Color for different levels</span>
              <el-rate v-model="value2" :colors="colors" allow-half/>
            </div>
          </van-col>

        </van-row>


    
    <div class="productDetails">
      <el-tabs type="border-card">
        <el-tab-pane>
          <span ><i class="el-icon-date"></i> 我的行程</span>
          我的行程
        </el-tab-pane>
        <el-tab-pane label="店铺中心">
          消息中心
        </el-tab-pane>
        <el-tab-pane label="商品详情" class="ProductDet">
          <div >
            商品详情
          </div>
        </el-tab-pane>
        <el-tab-pane label="评价" class="evaluate">
          <div class="evaluateEle">
            
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>

  </div>
</template>

<script>
import { ref } from 'vue'

export default {
  name:'productView',
  data() {
    return {
      product:[],
      imgarry:[],
      value2:null,
      colors :['#99A9BF', '#F7BA2A', '#FF9900']
    }
  },
  methods:{
    ni(){
      this.product[0] = JSON.parse(this.$route.query.item)
      this.imgarry = this.product[0].imgcollection
    },
    imgenter(item){
      this.product[0].imgurl = item
    }
  },
  created(){
    this.ni();
  }
  

}
</script>

<style scoped>
/* 大图 */
.bottom p{
  font-size: 3px;
  color: #999;
}

.bottom {
  /* margin-top: 13px; */
  /* line-height: 12px; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  width: 100%;
  height: 80%;
}

.button {
  font-size: 1px;
  padding: 0;
  margin-right: 0px;
  /* min-height: auto; */
}

.image {
  width: 100%;
  height: 80%;
  box-shadow: gold;
  display: block;
  
}
.d1{
  height:300px;
  padding: 20px;
}
div.van-pagination{
  width: 100%;
}
.block{
  text-align: center;
}
.d2{
  width: 100%;
  height: 60%;
  padding: 0px;
  overflow: hidden;
}
:deep(van-card){
  width: 100%;
  height: 500px;
  margin: 0;
  padding: 0;
}
.el-card__body{
  padding: 0;
  height: auto;
}
:deep(.van-row){
  width: 100%;
  height:auto;
}

:deep(.van-row .van-col van-col-6 d1){
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
.el-card.is-always-shadow{
  width: 100%;
  height: 100%;  
  margin: 0;
}
.el-card__body{
  width: 100%;
  height:100%;  
  padding: 0;
}
.van-image__img{
  width: 100%;
  height: 100%;
}
.prodname{
  width: 100%;
  height: 40%;
  padding: 0px;

}
.prodname>p{
  font-size: 10px;
}
.vanpagination{
  height: 10px;
}
.proditem{
  width: 50%;
  height: auto;
  /* padding: 20px; */
  float: left;
}

/* 图列表 */
.demo-image{
  margin-left: 150px;
  /* width: 70%; */
}
.demo-image .block {
  padding: 10px 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  display: inline-block;
  width: 10%;
  box-sizing: border-box;
  vertical-align: top;
}
.demo-image .block:last-child {
  border-right: none;
}
.demo-image .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}


/* 评分 */
.demo-rate-block {
  padding: 30px 0;
  text-align: center;
  border-right: solid 1px var(--el-border-color);
  display: inline-block;
  width: 49%;
  box-sizing: border-box;
}
.demo-rate-block:last-child {
  border-right: none;
}
.demo-rate-block .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}



/* 商品详情 */
.productDetails{
  width: 100%;
  height: 500px;
  color: rgb(54, 146, 226);
}
.evaluate{
  width: 100%;
  height: 500px;
  background-color: aqua;
  margin-bottom: 20px;
}
.evaluateEle{
  color: blue;
  background-color: blue;
  width: 100%;
  height: 200px;
  border: 1px;
  text-decoration: underline;
  /* text-decoration-line: overline; */
}
.ProductDet{
  width: 100%;
  height: 500px;

}
</style>